package com.example.mydemo.mydemo2;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;

@SpringBootApplication           //包括了组件扫描
public class Controller {

    public static void main(String[] args) {
        ApplicationContext applicationContext= SpringApplication.run(Controller.class, args);
        Service service= applicationContext.getBean(Service.class);
        System.out.println(service);
        Service service2= applicationContext.getBean(Service.class);
        System.out.println(service2);
        service.go();
    }

}
